import {Base} from'../../utils/base.js';

class Model extends Base{
  constructor(){
    super();
  }

  // 获取首页
  getIndex(callback){
    var param={
      url: '/index',
      success: function (res) {
        callback&&callback(res);
      },
      fail:function(res){
        callback && callback(res);
      }
    }
    this.request(param);
  }
  
  // 设置用户的上级
  setUserRefere(referee,callback){
    this.request({
      url:'/referee',
      type:'POST',
      data: { referee: referee},
      success:function(res){
        callback&&callback(res)
      },
      fail:function(res){
        callback && callback(res)
      }
    })
  }
}

const model=new Model();

export {model};